package cn.feizhu.aimarket.ai.workflow.model.enums;

public enum NodeStatus {

    PENDING("PENDING", "待处理"),
    RUNNING("RUNNING", "运行中"),
    IN_PROGRESS("IN_PROGRESS", "处理中"),
    COMPLETED("COMPLETED", "已完成"),
    FAILED("FAILED", "处理失败");

    final String code;
    final String desc;

    NodeStatus(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    NodeStatus getEnumByCode(String code) {
        for (NodeStatus status : NodeStatus.values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        return null;
    }
}
